const mongoose = require('mongoose');

//创建广告集合的约束对象
const advSchema = mongoose.Schema({
    //广告标题
    advTitle: {
        type: String,
        required: true
    },
    //广告类型
    advType: {
        type: String,
        required: true
    },
    //广告排序
    advOrder: {
        type: String,
        required: true
    },
    //图片地址
    advHref: {
        type: String,
        require: true,
    },
    //添加事件
    addTime: {
        type: String,
        require: true,
    },
    //更新时间
    updateTime: {
        type: String,
        require: true,
        default: "--"
    }
})

//根据这个约束对象创建一个广告列表的集合
const advModel = mongoose.model("advList" , advSchema)

//暴露这个集合
module.exports = advModel;
